#!/bin/csh -f
#          _/             _/_/
#        _/_/           _/_/_/
#      _/_/_/_/         _/_/_/
#      _/_/_/_/_/       _/_/_/              ____________________________________________ 
#      _/_/_/_/_/       _/_/_/             /                                           / 
#      _/_/_/_/_/       _/_/_/            /                                 28F00AP30 / 
#      _/_/_/_/_/       _/_/_/           /                                           /  
#      _/_/_/_/_/_/     _/_/_/          /                                     1Gbit / 
#      _/_/_/_/_/_/     _/_/_/         /                                single die / 
#      _/_/_/ _/_/_/    _/_/_/        /                                           / 
#      _/_/_/  _/_/_/   _/_/_/       /                  Verilog Behavioral Model / 
#      _/_/_/   _/_/_/  _/_/_/      /                               Version 1.5 / 
#      _/_/_/    _/_/_/ _/_/_/     /                                           /
#      _/_/_/     _/_/_/_/_/_/    /           Copyright (c) 2010 Numonyx B.V. / 
#      _/_/_/      _/_/_/_/_/    /___________________________________________/ 
#      _/_/_/       _/_/_/_/      
#      _/_/          _/_/_/  
# 
#     
#             NUMONYX              


set RUNDIR  = ./
set CODEDIR = ./code
set STIMDIR = ./stim
set TOPDIR  = ./top
set SIMDIR  = ./sim


if (-e $SIMDIR/work) then
\rm -r $SIMDIR/work
endif
vlib $SIMDIR/work


#CODE
vlog -work $SIMDIR/work $CODEDIR/28F00AP30.v
if ( $status != 0 ) exit 2


#STIM
#vlog -work $SIMDIR/work $STIMDIR//read/page_read.v
#vlog -work $SIMDIR/work $STIMDIR//program/simple_program.v
#vlog -work $SIMDIR/work $STIMDIR//program/buffered_program.v
#vlog -work $SIMDIR/work $STIMDIR//program/buffered_program_jq.v
#vlog -work $SIMDIR/work $STIMDIR//read/single_syncr_read.v
#vlog -work $SIMDIR/work $STIMDIR//burst/simple_read.v
vlog -work $SIMDIR/work $STIMDIR//burst/simple_read_debug_iSine.v
if ( $status != 0 ) exit 3


#TOP
vlog -work $SIMDIR/work $TOPDIR/top.v
if ( $status != 0 ) exit 4


# Simulate
cd $SIMDIR
vsim -gui -novopt -t 1fs -do do.do work.top  $1 &
if ( $status != 0 ) exit 5


